<form id="auto-data-form" action="dict/saveOrUpdate" class="form-horizontal bv-form" method="post" role="form">
	<div style="display: none;">
		<input id="model.id" name="model.id" value="#(model.id)" placeholder="主键" type="hidden" />
		<input id="model.parentId" name="model.parentId" value="#(model.parentId)" placeholder="上级节点" type="hidden" />
		<input id="model.type" name="model.type" value="#(model.type)" placeholder="代码类型" type="hidden" />
		<input id="model.sort" name="model.sort" value="#(model.sort)" placeholder="排序号" type="hidden" />
	</div>

	<div class="form-group">
		<label class="col-sm-2 control-label">上级代码</label>
		<div class="col-sm-10">
			<input value="#(parent.name??)" class="form-control input-md" readonly="readonly"/>
		</div>
	</div>
		
	<div class="form-group">
		<label for="model.val" class="col-sm-2 control-label">代码值</label>
		<div class="col-sm-10">
			<input id="model.val" name="model.val" value="#(model.val)" placeholder="代码值" class="form-control input-md" required maxlength="128"/>
		</div>
	</div>
	
	<div class="form-group">
		<label for="model.name" class="col-sm-2 control-label">代码名称</label>
		<div class="col-sm-10">
			<input id="model.name" name="model.name" value="#(model.name)" placeholder="代码中文名称" class="form-control input-md" required maxlength="128"/>
		</div>
	</div>
	
	<div class="form-group">
		<label for="model.ename" class="col-sm-2 control-label">代码简称</label>
		<div class="col-sm-10">
			<input id="model.ename" name="model.ename" value="#(model.ename)" placeholder="代码英文名称" class="form-control input-md" maxlength="128"/>
		</div>
	</div>
	
	<div class="form-group">
		<label for="model.state" class="col-sm-2 control-label">有效性</label>
		<div class="col-sm-10">
			 #@dict_select("model.state",model.state,"DATA_STATE",false,"有效性","required")
		</div>
	</div>
	
	<div class="form-group">
		<label for="model.remark" class="col-sm-2 control-label">描述</label>
		<div class="col-sm-10">
			<textarea id="model.remark" name="model.remark" placeholder="描述" class="form-control input-md auto" maxlength="512">#(model.remark)</textarea>
		</div>
	</div>
	<div id="ztree_form_tools" class="form-group text-center" style="display: none;">
		<button type="button" class="btn btn-success auto-btn auto-submit-ajax" data-callback="_callback"><i class="fa fa-check-square"></i>&nbsp;&nbsp;保存</a></button>
	</div>
</form>
<script type="text/javascript">
	function _callback(data){
		if(data.success) {
			jid("model.id").val(data.data);
			_updateZtreeNode(data.data,jid("model.name").val());
		}
	}
	$(document).ready(function() {
		if(ztree_mgr_pv){
			$("#ztree_form_tools").show();
		}
		var mtype=jid("model.type");
		if(mtype.val()==""){
			var node=_getCurrentNodeRoot( _getCurrentNode());
			if(null!=node)mtype.val(node.attributes.type);
		}
	});
</script>